package cn.bdqn.util;

import cn.bdqn.vo.AllHotelMessageVO;
import cn.bdqn.vo.CommentListVO;
import cn.bdqn.vo.ItripHotelOrderEx;
import cn.bdqn.vo.ItripListCommentVO;

import java.util.List;

/**
 * 分页工具
 * Created by Administrator on 2018/7/16.
 */
public class Page {

    /**
     * 当前页   外部传入
     */
    private long currentPage;


    /**
     * 共几页
     */
    private long pageCount;


    /**
     * 页容量
     */
    private long pageSize;

    /**
     * 总记录数  外部传入
     */
    private long total;

    /**
     * 起始页
     */
    private long start;

    /**
     * 询条件  外部传入
     */
    private ItripHotelOrderEx itripHotelOrderEx;


    /**
    *查询条件
     */
    private AllHotelMessageVO allHotelMessageVO;


    /**
     * 查询结果集合 外部传入
     */
    private List<?> rows;

    /**
     * 起始记录数
     */
    private long beginPos;

    /**
     * 结束记录数
     */
    private long endIndex;


    /**
     * 用户查询的模块路径
     */
    private String queryPath;


    private CommentListVO commentListVO;

    public CommentListVO getCommentListVO() {
        return commentListVO;
    }

    public void setCommentListVO(CommentListVO commentListVO) {
        this.commentListVO = commentListVO;
    }

    public String getQueryPath() {
        return queryPath;
    }

    public void setQueryPath(String queryPath) {
        this.queryPath = queryPath;
    }

    public Page() {
    }

    public Page(long currentPage, long total, long pageSize, ItripHotelOrderEx itripHotelOrderEx) {
        this.currentPage = currentPage;
        this.total = total;
        this.pageSize=pageSize;
        this.itripHotelOrderEx = itripHotelOrderEx;
        this.pageCount = total % pageSize == 0 ? total / pageSize : total / pageSize + 1;
        if (total == 0) {
            this.pageCount = 1;
        }
        this.start = (currentPage - 1) * pageSize;
        new Long(pageSize);
    }



    public Page(long currentPage, long totalRecords,long pageSize) {
        this.currentPage = currentPage;
        this.total = totalRecords;
        this.pageSize=pageSize;
        this.pageCount = totalRecords % pageSize == 0 ? totalRecords / pageSize : totalRecords / pageSize + 1;
        this.beginPos = (currentPage - 1) * pageSize;
    }

    public long getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(long currentPage) {
        this.currentPage = currentPage;
    }

    public long getPageCount() {
        return pageCount;
    }

    public void setPageCount(long pageCount) {
        this.pageCount = pageCount;
    }

    public long getPageSize() {
        return pageSize;
    }

    public void setPageSize(long pageSize) {
        this.pageSize = pageSize;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public AllHotelMessageVO getAllHotelMessageVO() {
        return allHotelMessageVO;
    }

    public void setAllHotelMessageVO(AllHotelMessageVO allHotelMessageVO) {
        this.allHotelMessageVO = allHotelMessageVO;
    }

    public List<?> getRows() {
        return rows;
    }

    public void setRows(List<?> rows) {
        this.rows = rows;
    }

    public long getBeginPos() {
        return beginPos;
    }

    public void setBeginPos(long beginPos) {
        this.beginPos = beginPos;
    }

    public long getEndIndex() {
        return endIndex;
    }

    public void setEndIndex(long endIndex) {
        this.endIndex = endIndex;
    }

    public long getStart() {
        return start;
    }

    public void setStart(long start) {
        this.start = start;
    }

    public ItripHotelOrderEx getItripHotelOrderEx() {
        return itripHotelOrderEx;
    }

    public void setItripHotelOrderEx(ItripHotelOrderEx itripHotelOrderEx) {
        this.itripHotelOrderEx = itripHotelOrderEx;
    }
}
